class DomainInfoModel {
  /// 排序1
  final String name;

  /// jgpx
  final String parentKey;

  /// jgpx
  final String childKey;

  /// "默认"
  final String key;

  /// “0”||"net,java,com,cn"
  final String value;

  /// 是否预览显示
  final bool? isShow;

  DomainInfoModel({
    required this.name,
    required this.parentKey,
    required this.childKey,
    required this.key,
    required this.value,
    this.isShow = true,
  });

  DomainInfoModel copyWith(
      {String? title,
      String? name,
      String? parentKey,
      String? childKey,
      String? key,
      String? value}) {
    return DomainInfoModel(
      name: name ?? this.name,
      parentKey: parentKey ?? this.parentKey,
      childKey: childKey ?? this.childKey,
      key: key ?? this.key,
      value: value ?? this.value,
    );
  }

  // 序列化方法（带类型安全校验）
  Map<String, dynamic> toJson() => {
        'name': name,
        'parentKey': parentKey,
        'childKey': childKey,
        'key': key,
        'value': value,
      };
}
